//#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
#define MAX_NODE 1000005
#define ALPHABET_SIZE 128
int tree[MAX_NODE][ALPHABET_SIZE] = { 0 }, cnt = 1;
bool isEnd[MAX_NODE];

void insert(string word) {
	int pos = 1;
	for (char c : word) {
		int index = c - '\0';
		if (!tree[pos][index]) {
			tree[pos][index] = ++cnt;
		}
		pos = tree[pos][index];
	}
	isEnd[pos] = true;
}

int find(string word) {
	int pos = 1;
	for (char c : word) {
		int index = c - '\0';
		if (!tree[pos][index]) {
			return 0;
		}
		pos = tree[pos][index];
	}
	if (isEnd[pos])
		return 1;
	else
		return 0;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	string ans[] = { "No","Yes" };
	for (int i = 0;i < n;i++) {
		int flag;
		string word;
		cin >> flag >> word;
		if (flag == 0)
			insert(word);
		else if (flag == 1)
			cout << ans[find(word)] << endl;
	}
	return 0;
}
